package com.cy1;

import jdk.swing.interop.SwingInterOpUtils;

import java.util.Calendar;
import java.util.Scanner;

public class CalendarTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你要查询二月天的年份：");
        int year = sc.nextInt();
        Calendar c = Calendar.getInstance();
       c.set(year,2,1);
       c.add(Calendar.DATE,-1);
        int date = c.get(Calendar.DATE);

        System.out.println(year+"年的2月有"+date+"天！");
    }
}
